﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkType_Admin.aspx.cs"
    Inherits="CarServiseSite.WorkType_Adminaspx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
    <link href="./style-template.css" rel="stylesheet" type="text/css">
    <title></title>
</head>
<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">
    <form id="form1" runat="server">
    <div>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tbody>
                <tr>
                    <td valign="top" width="542">
                        <img src="./images/pic01.jpg" height="131" width="542">
                    </td>
                    <td height="131" valign="top" align="left">
                        <img src="./images/logo.gif" height="131" width="228">
                    </td>
                </tr>
                <tr valign="top">
                    <td colspan="2" height="41">
                        <table width="770" border="0" cellpadding="0" cellspacing="0">
                            <tbody>
                                <tr>
                                    <td width="1%">
                                        <img src="./images/SPACER.GIF" height="41" width="12">
                                    </td>
                                    <td valign="middle" width="99%">
                                        <asp:Menu ID="ManagerMenu" runat="server" BorderStyle="Ridge" BorderWidth="1px" ItemWrap="True"
                                            Orientation="Horizontal" StaticSubMenuIndent="">
                                            <DynamicMenuItemStyle BorderStyle="Double" BorderWidth="1px" />
                                            <DynamicItemTemplate>
                                                <%# Eval("Text") %>
                                            </DynamicItemTemplate>
                                            <Items>
                                                <asp:MenuItem NavigateUrl="~/Insert_Work.aspx" Text="Добавить новый вид работы" Value="Inser new work">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/WorkType_Admin.aspx" Text="Типы работ" Value="Work types">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/Clients_Admin.aspx" Text="Добавление клиентов" Value="Добавление клиентов">
                                                </asp:MenuItem>
                                                <asp:MenuItem Text="Отчеты"
                                                    Value="Отчеты">
                                                    <asp:MenuItem NavigateUrl="~/DateServiceMonitor.aspx" Text="Фильтр заказов" 
                                                        Value="DateServiceMonitor"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/WorkersSum_Manager.aspx" Text="Сумма по работнику" 
                                                        Value="Workers sum"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/UserDuscount_Manager_Worker.aspx" 
                                                        Text="Подсчет скидки" Value="Calc discount"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/OparationSum_Manager.aspx" 
                                                        Text="Сумма по операции" Value="Operation sum"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/CheapestOpeartion_Manager.aspx" 
                                                        Text="Дешевые операции" Value="Cheapest operations"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/DiscountStatisctic.aspx" 
                                                        Text="Статистика по скидкам" Value="Статистика по скидкам"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/ExpensiveClients.aspx" 
                                                        Text="Клиенты использующие дорогие операции" 
                                                        Value="Клиенты использующие дорогие операции"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/GetDiscountAllClients_Manageraspx.aspx" 
                                                        Text="Скидки у клиентов" Value="Скидки у клиентов"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/SumAllServicesbyWorkerAll_Manager.aspx" 
                                                        Text="Доход работников по операциям" Value="Доход работников по операциям">
                                                    </asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/SumCostAllClients.aspx" Text="Сумма по клиенту" 
                                                        Value="Сумма по клиенту"></asp:MenuItem>
                                                    <asp:MenuItem NavigateUrl="~/SumServiceByClients.aspx" 
                                                        Text="Сумма по услуге и клиенту" Value="Сумма по услуге и клиенту">
                                                    </asp:MenuItem>
                                                </asp:MenuItem>
                                            </Items>
                                            <StaticMenuItemStyle BackColor="#185490" Font-Bold="True" ForeColor="White" Height="60px"
                                                HorizontalPadding="10px" />
                                            <StaticMenuStyle Width="758px" />
                                        </asp:Menu>
                                        <asp:Menu ID="AdminMenu" runat="server" BorderStyle="Ridge" BorderWidth="1px" ItemWrap="True"
                                            Orientation="Horizontal" StaticSubMenuIndent="">
                                            <DynamicMenuItemStyle BorderStyle="Double" BorderWidth="1px" />
                                            <DynamicItemTemplate>
                                                <%# Eval("Text") %>
                                            </DynamicItemTemplate>
                                            <Items>
                                                <asp:MenuItem NavigateUrl="~/Admins_Admin.aspx" Text="Администраторы" Value="Admins">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/Clients_Admin.aspx" Text="Клиенты" Value="Clients">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/Managers_Admin.aspx" Text="Менеджеры" Value="Managers">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/Workers_Admin.aspx" Text="Работники" Value="Workers">
                                                </asp:MenuItem>
                                                <asp:MenuItem NavigateUrl="~/WorkType_Admin.aspx" Text="Типы работ" Value="WorkType">
                                                </asp:MenuItem>
                                            </Items>
                                            <StaticMenuItemStyle BackColor="#185490" Font-Bold="True" ForeColor="White" Height="60px"
                                                HorizontalPadding="10px" />
                                            <StaticMenuStyle Width="758px" />
                                        </asp:Menu>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <table height="100%" width="770" bgcolor="185490" border="0" cellpadding="2" cellspacing="1">
            <tbody>
                <tr>
                    <td height="40" valign="middle" align="left" bgcolor="2792FF">
                        Типы работ
                        
                        <div align="right">
                            <asp:Button ID="ButtonExit" runat="server" Text="Выход" onclick="ButtonExit_Click" />
                        </div>

                    </td>
                </tr>
                <tr>
                    <td valign="top" align="left" bgcolor="DAECFF">
                        <table class="text" height="100%" width="95%" border="0" cellpadding="5" cellspacing="0">
                            <tbody>
                                <tr>
                                    <td valign="top">
                                        <asp:GridView ID="GridView3" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                            DataKeyNames="ServiceID" DataSourceID="TypeServiceDataSource" EnableModelValidation="True"
                                            AllowSorting="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
                                            BorderWidth="1px" CellPadding="3">
                                            <Columns>
                                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderText="Команды" />
                                                <asp:BoundField DataField="ServiceID" HeaderText="ID Услуги" InsertVisible="False"
                                                    ReadOnly="True" SortExpression="ServiceID" />
                                                <asp:BoundField DataField="Name" HeaderText="Название" SortExpression="Name" />
                                                <asp:BoundField DataField="Description" HeaderText="Описание" SortExpression="Description" />
                                            </Columns>
                                            <FooterStyle BackColor="White" ForeColor="#000066" />
                                            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                            <RowStyle ForeColor="#000066" />
                                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                        </asp:GridView>
                                        <asp:SqlDataSource ID="TypeServiceDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CarServiceConnectionString %>"
                                            DeleteCommand="DELETE FROM [ServiceType] WHERE [ServiceID] = @ServiceID" InsertCommand="INSERT INTO [ServiceType] ([Name], [Description]) VALUES (@Name, @Description)"
                                            SelectCommand="SELECT * FROM [ServiceType]" UpdateCommand="UPDATE [ServiceType] SET [Name] = @Name, [Description] = @Description WHERE [ServiceID] = @ServiceID">
                                            <DeleteParameters>
                                                <asp:Parameter Name="ServiceID" Type="Int32" />
                                            </DeleteParameters>
                                            <InsertParameters>
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Description" Type="String" />
                                            </InsertParameters>
                                            <UpdateParameters>
                                                <asp:Parameter Name="Name" Type="String" />
                                                <asp:Parameter Name="Description" Type="String" />
                                                <asp:Parameter Name="ServiceID" Type="Int32" />
                                            </UpdateParameters>
                                        </asp:SqlDataSource>
                                        <br />
                                        <div id="clickme">
                                            Добавление типа работ
                                        </div>
                                        <br />
                                        <div id="updown">
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label11" runat="server" Text="Название"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBox11" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox11"
                                                            ErrorMessage="Поле не может быть пустым" ValidationGroup="1"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:Label ID="Label12" runat="server" Text="Описание"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TextBox12" runat="server"></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox12"
                                                            ErrorMessage="Поле не может быть пустым" ValidationGroup="1"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                            <asp:Button ID="Button3" ValidationGroup=1 runat="server" Text="Добавить" OnClick="Button3_Click" />
                                            <div id="Div1">
                                            </div>
                                            <script>
                                                $("#clickme").click(function () {
                                                    $("#updown").slideToggle("slow");
                                                });
                                            </script>
                                            <script>
                                                $('#updown').hide();
                                            </script>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" valign="bottom" align="center">
                                        <asp:Label ID="ErrLabel" runat="server"></asp:Label>Powered by Fifth Wheel 2011.
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    </form>
</body>
</html>
